import request from '@/utils/request'

const api_name = '/eduservice/teacher'
export default {
  getPageList(page, limit, seacherObj) {
    console.log('请求数据的接口')
    console.log(seacherObj)
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: 'post',
      data: seacherObj
    })
  },
  removeById(teacherId) {
    return request({
      url: `${api_name}/${teacherId}`,
      method: 'delete'
    })
  },
  save(teacher) {
    return request({
      url: api_name,
      method: 'post',
      data: teacher
    })
  },
  getById(id) {
    return request({
      url: `${api_name}/${id}`,
      method: 'get'
    })
  },
  // 更新数据
  updateById(teacher) {
    return request({
      url: `${api_name}/${teacher.id}`,
      method: 'put',
      data: teacher
    })
  },
  getList() {
    return request({
      url: `${api_name}/findAll`,
      method: 'get'
    })
  }

}
